package com.jzr.board.ui.adapter

import android.graphics.Color
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.cardview.widget.CardView
import com.chad.library.adapter.base.BaseItemDraggableAdapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.jzr.board.R
import com.jzr.board.bean.CareLabelListBean
import com.jzr.board.bean.NurseListBean
import com.jzr.board.bean.PatientCareLabelListBean

class PatientCareLabelAdapter(data: MutableList<PatientCareLabelListBean.DataBean>?) :
    BaseItemDraggableAdapter<PatientCareLabelListBean.DataBean, BaseViewHolder>(
            R.layout.item_carelabel,
            data
        ) {


        override fun convert(helper: BaseViewHolder?, item: PatientCareLabelListBean.DataBean?) {
            helper?.setText(R.id.tvName,item?.labelName)
            val rlItem = helper?.getView<CardView>(R.id.rlItem)
            val tvName = helper?.getView<TextView>(R.id.tvName)
            rlItem?.setBackgroundColor(Color.parseColor(item?.bgColor))
            tvName?.setTextColor(Color.parseColor(item?.fontColor))
        }


    private var onItemClick: onListItemClick? = null

    interface onListItemClick {
        fun onListItemClick(item: NurseListBean.DataBean?)
    }

    fun onListItemClick(onListItemClick: onListItemClick?) {
        this.onItemClick = onListItemClick
    }





}